function [] = pp_booth_encoded_tb()
    A = [0 0 1 0 1 0 0 1 1 0 0 0]; % 1 -1 -2 2 -2 0
    B = [1 1 1 1 1 1 1 1 1 1]; % -1
    X = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
         1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
         0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
         0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
         1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0];
    Z = pp_booth_encoded(A,B);
    assert2(A,B,Z,X,1,60);
    
    A = [0 0 1 0 1 0 0 1 1 0 0 0]; % 1 -1 -2 2 -2 0
    B = [0 0 0 0 0 0 0 0 0 1]; % 1
    X = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0
         0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
         1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
         1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
         0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0];
    Z = pp_booth_encoded(A,B);
    assert2(A,B,Z,X,1,60);
end

function [] = assert(A, B,Z,X)
    if(X == Z)
        fprintf('\tJa: %s*%s => %s\n',mat2str(A),mat2str(B),mat2str(Z));
    else
        fprintf('\tNej: %s*%s => %s (%s)\n',mat2str(A),mat2str(B),mat2str(Z),mat2str(X));       
    end
end